/**
 * Created by zenoniaonline on 14. 4. 4.
 */

var mongojs = require('mongojs');
var db = mongojs('172.16.3.151/pz_user', ['log_pvp_play']);

exports.test = function(req, res){
    db.log_pvp_play.findOne({user_seq:2}, function(err, docs) {
        res.render('jjaehuny/jjaehuny_test', { title: 'Express', docs:docs });
    });
};

exports.startup_test = function(req, res){
    db.log_pvp_play.findOne({user_seq:2}, function(err, docs) {
        console.log("startup_test");
        var data = google.visualization.arrayToDataTable([
            ['a', 'Hours per Day'],
            ['b',     11],
            ['c',      2],
            ['Commute',  2],
            ['Watch TV', 2],
            ['Sleep',    7]
        ]);
        res.render('jjaehuny/startup_test', { title: 'Zenonia Online', docs:docs , data:data});
    });
};

exports.jjaehuny_old = function(req, res){

    res.render('jjaehuny/jjaehuny_startup', { title: 'Zenonia Online' });
//    db.log_pvp_play.findOne({user_seq:2}, function(err, docs) {
//        console.log("startup_test");
//        res.render('jjaehuny/jjaehuny_startup', { title: 'Zenonia Online', docs:docs });
//    });
};